#先引入模块1、url编码
from urllib.parse import urlencode
from urllib.request import quote
ff = '摄像头'
ff = quote(ff)
print(ff)



# 解码是另一个模块2、url解码
from urllib import parse
aa = '%E6%91%84%E5%83%8F%E5%A4%B4'
ret = parse.unquote(aa)
print(ret)


# 将字典格式直接转换成url参数格式
url = {'url':'www.baidu.com'}
print(urlencode(url))
